package com.qining618.cms.ucenter.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qining618.cms.ucenter.domain.RoleMenu;
import com.qining618.cms.ucenter.mapper.RoleMenuMapper;
import com.qining618.cms.ucenter.service.RoleMenuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author flt
 * @date 2019-09-21
 */
@Transactional(readOnly = true, rollbackFor = Exception.class)
@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements RoleMenuService {

    @Override
    public List<String> getMenuCodeByRoleId(Long roleId) {
        return this.baseMapper.findMenuCodeByRoleId(roleId);
    }

    @Override
    public void deleteByRoleId(Long roleId) {
        this.baseMapper.deleteByRoleId(roleId);
    }

    @Override
    public void deleteByMenuId(Long menuId) {
        this.baseMapper.deleteByMenuId(menuId);
    }

}
